"use strict";
cc._RF.push(module, '0333cjYe4lBEYQavNOm8jwJ', 'Toast');
// scripts/Toast.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});
var a = cc._decorator,
    n = a.ccclass,
    i = (a.property, function (e) {
  function t() {
    return null !== e && e.apply(this, arguments) || this;
  }

  var o;
  return nn(t, e), o = t, t.showNewToast = function (e, t, a) {
    void 0 === t && (t = cc.Color.BLACK), void 0 === a && (a = 0);
    var n = o.createSpriteNode("toast", null, cc.find("Canvas"));
    n.width = 400, n.height = 100;
    var i = o.createNode("txt", n);
    i.width = 400, i.height = 100, i.addComponent(cc.Label), i.getComponent(cc.Label).overflow = cc.Label.Overflow.NONE, i.getComponent(cc.Label).fontSize = 32, i.getComponent(cc.Label).string = e, i.getComponent(cc.Label).enableBold = !0, i.addComponent(cc.LabelOutline), i.getComponent(cc.LabelOutline).color = cc.Color.WHITE, i.getComponent(cc.LabelOutline).width = 2, i.color = t, n.setPosition(cc.v2(0, -150 + a)), n.zIndex = cc.find("Canvas").childrenCount + 1, cc.tween(n).by(1, {
      position: cc.v2(0, 150)
    }).call(function () {
      n.destroy();
    }).start();
  }, t.createSpriteNode = function (e, t, o) {
    var a = new cc.Node(e);
    return a.addComponent(cc.Sprite).spriteFrame = t, null != o ? o.addChild(a) : cc.director.getScene().addChild(a), a;
  }, t.createNode = function (e, t, o) {
    void 0 === o && (o = new cc.Vec2(0, 0));
    var a = new cc.Node(e);
    return null != t ? t.addChild(a) : cc.director.getScene().addChild(a), a;
  }, o = oo([n], t);
}(cc.Component));
o["default"] = i;

cc._RF.pop();